import axios from "axios";

const baseURL = 'http://localhost:8080/';

const axioxInstance = axios.create({
  baseURL: baseURL,
  timeout: 9000,
  headers: {
    'Content-Type': 'application/json',
  }
});

export default class HttpRequest {
  static async get(url: string) {
    return await axioxInstance.get(url);
  }
  static async post(url: string, data: any) {
    return await axioxInstance.post(url, data);
  }
  static async put(url: string, data: any) {
    return await axioxInstance.put(url, data);
  }
  static async delete(url: string, data: any) {
    return await axioxInstance.delete(url, data);
  }
}